home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE3 / SCRIBBLE / !Scribble / Scribble < prev   
Text File  |  2002-07-04  |  1KB  |  48 lines

  1. -- Scribble v.0.1
  2. -- G.C.Wraith 03/07/02
  3.  
  4. do
  5. local PDF = {}
  6. settag(PDF,newtag())
  7.  
  8. local END = function (x)
  9.             x:end_page()
  10.             x:close()
  11.             x:delete()
  12.             execute("settype "..x.file.." pdf")
  13.             end -- function
  14.  
  15. settagmethod(tag(PDF),"gettable",function (a,i)
  16.              local f = getglobal("PDF_"..i)
  17.              if f == nil then return rawgettable(a,i)
  18.              else
  19.                return function (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
  20.                       return %f(a1.p,a2,a3,a4,a5,a6,a7,a8,a9,a10)
  21.                       end -- function
  22.              end -- if
  23.           end)            
  24.  
  25. BEGIN = function (file)
  26.          local p = PDF_new()
  27.          assert(PDF_open_file(p,file))
  28.          local x = { p = p, file = file, END = %END}
  29.          settag(x,tag(%PDF))
  30.          return x
  31.          end -- function
  32. end -- do
  33.  
  34. A0 = { width = 2380, height = 3368 }
  35. A1 = { width = 1684, height = 2380 }
  36. A2 = { width = 1190, height = 1684 }
  37. A3 = { width = 842, height = 1190 }
  38. A4 = { width = 595, height = 842 }
  39. A5 = { width = 421, height = 595 }
  40. A6 = { width = 297, height = 421 }
  41. B5 = { width = 501, height = 709 }
  42. Letter = { width = 612, height = 792 }
  43. Legal = { width = 612, height = 1008 }
  44. Ledger = { width = 1224, height = 792 }
  45.  
  46. dofile(arg[1])
  47.  
  48. ----------------------------